/*
*  class:定义了一切事物的抽象特点
*  Object: class的实例
*  OOP： 封装（接口）、继承(子类继承父类)、多态(继承产生多的方法和属性，会产生不同的方法和属性)
* */

class Animal{
  constructor(name) {
    this.name = name
  }
  run(){
    return `${this.name} is running`
  }
}

const coder = new Animal('wangyang')
console.log(coder.run());

class Dog extends Animal{
  bark(){
    return `${this.name} is barking`
  }
}


const xiaobao = new Dog('xiaobao')
console.log(xiaobao.run());
console.log(xiaobao.bark());


class Cat extends Animal{
  static categories  = ['maomao']
  constructor(name) {
    super(name);
    console.log(this.name);
  }
  run() {
    return 'wang,' + super.run();
  }
}
const maomao = new Cat('maomao')
console.log(maomao.run());

console.log(Cat.categories);
